var mongoose = require('./setmongoose');

var userSchema = new mongoose.Schema({
  phone: { type: String, index: true, unique: true },
  password: { type: String, required: true },
  nickname: String,
  avatar: String,
  createdAt: { type: Date, default: Date.now },
  updatedAt: { type: Date, default: Date.now }
});

var userModel = mongoose.model('user', userSchema, 'user');

module.exports = userModel;


